package org.itboys.trade.service.mysql;

import java.util.List;
import java.util.Map;

import org.itboys.trade.dao.UserWithdrawRecordMapper;
import org.itboys.trade.entity.mysql.UserWithdrawRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserWithdrawRecordService {
	
	@Autowired
	private UserWithdrawRecordMapper mapper;
	
	public  List<UserWithdrawRecord> list(Map<String, Object> search){
		return mapper.list(search);
	};
	public UserWithdrawRecord getById(long id){
		return mapper.getById(id);
	};
	public Long count(Map<String, Object> search){
		return mapper.count(search);
	};
	public int insert(UserWithdrawRecord record){
		return mapper.insert(record);
	};
	public int userWithdraw(Long userId,Double amount){
		return insert(new UserWithdrawRecord(userId, 0d, amount, null, null));
	}
}
